<template>
	<div>
		<navbar></navbar>
		<userdetail :username="username" :userdata="userdata"></userdetail>
	</div>
</template>

<script>
import navbar from '@/components/common/Navbar.vue';
import userdetail from '@/components/user/userdetail.vue';

export default {
	data() {
		return {
			username: '',
			userdata: {}
		};
	},
	components: {
		navbar,
		userdetail
	},
	methods: {
		async getuserinfo() {
			const res = await this.$http.get('/user/' + localStorage.getItem('id'));
			console.log(res);
			this.userdata = res.data[0];
			this.username = res.data[0].name;
		}
	},
	created() {
		this.getuserinfo();
	}
};
</script>

<style></style>
